<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
    <head>
        <meta name="generator" content="HTML Tidy, see www.w3.org">
        <meta http-equiv="Content-Type" content= "text/html; charset=iso-8859-1">
        <title>Untitled Document</title>
        <script type="text/javascript" src="http://www.google.com/jsapi">
        </script>
        <script type="text/javascript" src="jquery-1.4.2.js">
        </script>
        <script type="text/javascript">
            
            
            var mydata = new Array();
            
            
            google.load("visualization", "1", {
                packages: ["columnchart"]
            });
            
            function Results(whereToShow){
                mydata[0] = .445;
                mydata[1] = .85;
                //alert('constructer success');
                
            }
            
            
            
            
            
            
            
            
            Results.prototype.display = function(){
            
                try {
                    alert("hi");
                    google.setOnLoadCallback(this.drawChart);
                    
                } 
                catch (e) {
                    alert("Error in Results.display(): " + e);
                }
            }
            
            
            
            
            Results.prototype.drawChart = function(){
            
                
                 try {
                 var data = new google.visualization.DataTable();
                 
                 /* Change this to our data..*/
                 data.addColumn('string', 'Population');
                 data.addColumn('number', 'LGBT Percentage');
                 
                 var dataArrLen = mydata.length;
                 data.addRows(dataArrLen);
                 
                 try {
                 for (var i = 0; i < dataArrLen; i++) {
                 var tempChar = (i + 1) + '';
                 data.setValue(i, 0, tempChar); // i+1 = population number
                 data.setValue(i, 1, parseFloat(mydata[i]));
                 }
                 }catch(e){
                 alert("Error in array loop: "+e);
                 }
                 
                 
                 var chart = new google.visualization.ColumnChart($("#chart_div")[0]);
                 
                 
                 chart.draw(data, {width: 400,height: 240,is3D: true, title: 'LGBT Percentage in each population'});
                 
                 
                 }catch(e){
                 alert("Error at drawChart: "+e);
                 }
                 
                 /*	
                var data = new google.visualization.DataTable();
                data.addColumn('string', 'Year');
                data.addColumn('number', 'Sales');
                data.addColumn('number', 'Expenses');
                data.addRows(4);
                data.setValue(0, 0, '2004');
                data.setValue(0, 1, 1000);
                data.setValue(0, 2, 400);
                data.setValue(1, 0, '2005');
                data.setValue(1, 1, 1170);
                data.setValue(1, 2, 460);
                data.setValue(2, 0, '2006');
                data.setValue(2, 1, 660);
                data.setValue(2, 2, 1120);
                data.setValue(3, 0, '2007');
                data.setValue(3, 1, 1030);
                data.setValue(3, 2, 540);
                */
				
				
				try {
					
					
					var chart = new google.visualization.ColumnChart($('chart_div')[0]);
					chart.draw(data, {
						width: 400,
						height: 240,
						title: 'Company Performance',
						hAxis: {
							title: 'Year',
							titleColor: 'red'
						}
					});
					
				}catch(e){
					alert("Error in drawChart: "+e);
				}
            }
            
            
            
            try {
            
                var newGuy = new Results();
                newGuy.display();
            } 
            catch (e) {
                alert("Error at main execution:" + e);
            }
            
            alert("hi");
        </script>
    </head>
    <body>
        <div id="chart_div">I'm in chart_div!</div>
    </body>
</html>
